package annotation;

import org.junit.Test;

import java.lang.reflect.Method;

public class Run {
    @MyTarget
    public void doSth(){}

    @Test
    public void method() throws NoSuchMethodException {
        Method method = Run.class.getMethod("doSth", null);
        if (method.isAnnotationPresent(MyTarget.class)) {
            System.out.println(method.getAnnotation(MyTarget.class));
        }
    }
}
